package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.service.IMyMessageRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/mymessagerelation")
public class MyMessageRelationController {

    @Autowired
    private IMyMessageRelationService myMessageRelationService;


    /**
     * 删除对应的我的信息的记录
     * 资源：/mymessagerelation/{id}
     * 参数：无
     * 动作：DELETE
     */
    @DeleteMapping("/{id}")
    public void deleteMyMessage(@PathVariable Long id, HttpServletResponse resp){
        myMessageRelationService.deleteById(id);
        resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
    }
}
